package timbap.visualizer.api.plugin.poscloud;

import timbap.visualizer.api.model.Cacheable;
import timbap.visualizer.api.model.PlaylistEntry;
import timbap.visualizer.api.plugin.poscloud.cache.PosCloudCache;
import timbap.visualizer.api.plugin.poscloud.cache.AbstractPosCloudMapXmlAdapter;

/**
 * The <code>CacheablePosCloudPlugin</code> is the base interface
 * for all positioning cloud plugins that can cache their positioning
 * cloud items for better start-up performance.
 *
 * @author  Andreas Pabst
 * @see     timbap.visualizer.api.plugin.poscloud.PosCloudPlugin
 * @see     timbap.visualizer.api.plugin.poscloud.cache.PosCloudCache
 */
public interface CacheablePosCloudPlugin<T> extends PosCloudPlugin<T>,
                                                    Cacheable<PosCloudCache<T>> {

    /**
     * determines whether the given cached positioning cloud 
     * element is still valid for the given playlist entry
     * 
     * @param pPlaylistEntry	the playlist entry to use for check
     * @param pPosCloudElement	the cached positioning cloud element to check 
     * @return
     */
    public boolean isCachedPosCloudElementValid(PlaylistEntry pPlaylistEntry, T pPosCloudElement);

    /**
     * gets the xml<->java adapter to use for the map of playlist 
     * entries and associated positioning cloud elements 
     * 
     * @return	the xml<->java adapter for the positioning cloud map
     */
    public AbstractPosCloudMapXmlAdapter<T> getPosCloudMapXmlAdapter();

}
